﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "RuleBullet.generated.h"

UCLASS()
class TF_20240717_API ARuleBullet : public AActor
{
	GENERATED_BODY()

	// 粒子特效（需要时在蓝图中添加）
	// UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="BaseAttribute", meta=(AllowPrivateAccess=true))
	// UParticleSystemComponent* ParticleMesh;

	// 碰撞盒子
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="BaseAttribute", meta=(AllowPrivateAccess=true))
	class USphereComponent* BoxDamage;

	// 作为根组件
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="BaseAttribute", meta=(AllowPrivateAccess=true))
	USceneComponent* RootBullet;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="BaseAttribute", meta=(AllowPrivateAccess=true))
	class UProjectileMovementComponent* ProjectileMovement;
	

public:
	ARuleBullet();

protected:
	virtual void BeginPlay() override;

	// bFromSweep 是否开始扫描；SweepResult 扫描结果
	UFUNCTION()
	void BeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

public:
	virtual void Tick(float DeltaTime) override;
};
